package com.macro.mall.controller;

import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.PmsProduct;
import com.macro.mall.service.UmsPortalBrandService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author：MinxiaoHao
 * @Description:
 * @name：PmsPortalBrandController
 * @Date：2024/10/18 19:09
 */
@RestController
@RequestMapping("/brand")
public class UmsPortalBrandController {
    @Autowired
    private UmsPortalBrandService pmsPortalBrandService;

    @GetMapping(value = "/productList")
    @ApiOperation("获取品牌详情")
    public CommonResult<CommonPage<PmsProduct>> productList(@RequestParam Integer brandId,
                                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                            @RequestParam(value = "pageSize", defaultValue = "3") Integer pageSize) {
        CommonPage<PmsProduct> result = pmsPortalBrandService.productList(brandId,pageNum, pageSize);
        return CommonResult.success(result);
    }
}
